home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / emacs-19.000 / emacs-19 / usr / local / info / emacs-5 < prev    next >
Encoding:
GNU Info File  |  1995-09-11  |  47.0 KB  |  1,115 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.55 from the
  2. input file emacs.texi.
  3.  
  4. 
  5. File: emacs,  Node: European Display,  Next: Optional Mode Line,  Prev: Selective Display,  Up: Display
  6.  
  7. European Character Set Display
  8. ==============================
  9.  
  10.    Some European languages use accented letters and other special
  11. symbols.  The ISO 8859 Latin-1 character set defines character codes for
  12. many European languages in the range 160 to 255.
  13.  
  14.    Emacs can display those characters according to Latin-1, provided the
  15. terminal or font in use supports them.  The `M-x
  16. standard-display-european' command toggles European character display
  17. mode.  With a numeric argument, `M-x standard-display-european' enables
  18. European character display if and only if the argument is positive.
  19. Load the library `iso-syntax' to specify the correct syntactic
  20. properties and case conversion table for the Latin-1 character set.
  21.  
  22.    Some operating systems let you specify the language you are using by
  23. setting a locale.  Emacs handles one common special case of this: if
  24. your locale name for character types contains the string `8859-1' or
  25. `88591', Emacs automatically enables European character display mode
  26. and its syntax.
  27.  
  28.    There are three different ways you can enter Latin-1 characters:
  29.  
  30.    * If your keyboard can generate character codes 128 and up,
  31.      representing ISO Latin-1 characters, execute the following
  32.      expression to enable Emacs to understand them:
  33.  
  34.           (set-input-mode (car (current-input-mode))
  35.                           (nth 1 (current-input-mode))
  36.                           0)
  37.  
  38.    * You can load the library `iso-transl' to turn the key `C-x 8' into
  39.      a "compose character" prefix for entry of the extra ISO Latin-1
  40.      printing characters.  `C-x 8' is good for insertion (in the
  41.      minibuffer as well as other buffers), for searching, and in any
  42.      other context where a key sequence is allowed.  The ALT modifier
  43.      key, if you have one, serves the same purpose as `C-x 8'; use ALT
  44.      together with an accent character to modify the following letter.
  45.  
  46.    * You can use ISO Accents mode.  This minor mode is convenient if you
  47.      enter non-ASCII ISO Latin-1 characters often.  When this minor
  48.      mode is enabled, the characters ``', `'', `"', `^', `/' and `~'
  49.      modify the following letter by adding the corresponding
  50.      diacritical mark to it, if possible.  To enable or disable ISO
  51.      Accents mode, use the command `M-x iso-accents-mode'.  This
  52.      command affects only the current buffer.
  53.  
  54.      To enter one of those six special characters while in ISO Accents
  55.      mode, type the character, followed by a space.  Some of those
  56.      characters have a corresponding "dead key" accent character in the
  57.      ISO Latin-1 character set; to enter that character, type the
  58.      corresponding ASCII character twice.  For example, `''' enters the
  59.      Latin-1 character acute-accent (character code 0264).
  60.  
  61.      ISO Accents mode input is available whenever a key sequence is
  62.      expected: for ordinary insertion, for searching, for the
  63.      minibuffer, and for certain command arguments.
  64.  
  65.      In addition to the accented letters, you can use these special
  66.      sequences in ISO Accents mode to enter certain other ISO Latin-1
  67.      characters:
  68.  
  69.     `/A'
  70.           `A' with ring.
  71.  
  72.     `~C'
  73.           `C' with cedilla.
  74.  
  75.     `~D'
  76.           `D' with stroke.
  77.  
  78.     `/E'
  79.           `AE' ligature.
  80.  
  81.     `/a'
  82.           `a' with ring.
  83.  
  84.     `~c'
  85.           `c' with cedilla.
  86.  
  87.     `~d'
  88.           `d' with stroke.
  89.  
  90.     `/e'
  91.           `ae' ligature.
  92.  
  93.     `"s'
  94.           German sharp `s'.
  95.  
  96.     `~<'
  97.           Left guillemet.
  98.  
  99.     `~>'
  100.           Right guillemet.
  101.  
  102.     `~!'
  103.           Inverted exclamation mark.
  104.  
  105.     `~?'
  106.           Inverted question mark.
  107.  
  108. 
  109. File: emacs,  Node: Optional Mode Line,  Next: Display Vars,  Prev: European Display,  Up: Display
  110.  
  111. Optional Mode Line Features
  112. ===========================
  113.  
  114.    To add the current line number of point to the mode line, enable Line
  115. Number mode with the command `M-x line-number-mode'.  The line number
  116. appears before the buffer percentage POS, with the letter `L' to
  117. indicate what it is.  *Note Minor Modes::, for more information about
  118. minor modes and about how to use this command.
  119.  
  120.    If the buffer is very large (larger than the value of
  121. `line-number-display-limit'), then the line number doesn't appear.
  122. Emacs doesn't compute the line number when the buffer is large, because
  123. that would be too slow.  If you have narrowed the buffer (*note
  124. Narrowing::.), the displayed line number is relative to the accessible
  125. portion of the buffer.
  126.  
  127.    Emacs can optionally display the time and system load in all mode
  128. lines.  To enable this feature, type `M-x display-time'.  The
  129. information added to the mode line usually appears after the buffer
  130. name, before the mode names and their parentheses.  It looks like this:
  131.  
  132.      HH:MMpm L.LL
  133.  
  134. Here HH and MM are the hour and minute, followed always by `am' or
  135. `pm'.  L.LL is the average number of running processes in the whole
  136. system recently.  (Some fields may be missing if your operating system
  137. cannot support them.)
  138.  
  139.    The word `Mail' appears after the load level if there is mail for
  140. you that you have not read yet.
  141.  
  142. 
  143. File: emacs,  Node: Display Vars,  Prev: Optional Mode Line,  Up: Display
  144.  
  145. Variables Controlling Display
  146. =============================
  147.  
  148.    This section contains information for customization only.  Beginning
  149. users should skip it.
  150.  
  151.    The variable `mode-line-inverse-video' controls whether the mode
  152. line is displayed in inverse video (assuming the terminal supports it);
  153. `nil' means don't do so.  *Note Mode Line::.  If you specify the
  154. foreground color for the `modeline' face, and `mode-line-inverse-video'
  155. is non-`nil', then the default background color for that face is the
  156. usual foreground color.  *Note Faces::.
  157.  
  158.    If the variable `inverse-video' is non-`nil', Emacs attempts to
  159. invert all the lines of the display from what they normally are.
  160.  
  161.    If the variable `visible-bell' is non-`nil', Emacs attempts to make
  162. the whole screen blink when it would normally make an audible bell
  163. sound.  This variable has no effect if your terminal does not have a way
  164. to make the screen blink.
  165.  
  166.    When you reenter Emacs after suspending, Emacs normally clears the
  167. screen and redraws the entire display.  On some terminals with more than
  168. one page of memory, it is possible to arrange the termcap entry so that
  169. the `ti' and `te' strings (output to the terminal when Emacs is entered
  170. and exited, respectively) switch between pages of memory so as to use
  171. one page for Emacs and another page for other output.  Then you might
  172. want to set the variable `no-redraw-on-reenter' non-`nil'; this tells
  173. Emacs to assume, when resumed, that the screen page it is using still
  174. contains what Emacs last wrote there.
  175.  
  176.    The variable `echo-keystrokes' controls the echoing of
  177. multi-character keys; its value is the number of seconds of pause
  178. required to cause echoing to start, or zero meaning don't echo at all.
  179. *Note Echo Area::.
  180.  
  181.    If the variable `ctl-arrow' is `nil', control characters in the
  182. buffer are displayed with octal escape sequences, all except newline
  183. and tab.  Altering the value of `ctl-arrow' makes it local to the
  184. current buffer; until that time, the default value is in effect.  The
  185. default is initially `t'.  *Note Display Tables: (elisp)Display Tables.
  186.  
  187.    Normally, a tab character in the buffer is displayed as whitespace
  188. which extends to the next display tab stop position, and display tab
  189. stops come at intervals equal to eight spaces.  The number of spaces
  190. per tab is controlled by the variable `tab-width', which is made local
  191. by changing it, just like `ctl-arrow'.  Note that how the tab character
  192. in the buffer is displayed has nothing to do with the definition of TAB
  193. as a command.  The variable `tab-width' must have an integer value
  194. between 1 and 1000, inclusive.
  195.  
  196.    If the variable `truncate-lines' is non-`nil', then each line of
  197. text gets just one screen line for display; if the text line is too
  198. long, display shows only the part that fits.  If `truncate-lines' is
  199. `nil', then long text lines display as more than one screen line,
  200. enough to show the whole text of the line.  *Note Continuation Lines::.
  201. Altering the value of `truncate-lines' makes it local to the current
  202. buffer; until that time, the default value is in effect.  The default
  203. is initially `nil'.
  204.  
  205.    If the variable `truncate-partial-width-windows' is non-`nil', it
  206. forces truncation rather than continuation in any window less than the
  207. full width of the screen or frame, regardless of the value of
  208. `truncate-lines'.  For information about side-by-side windows, see
  209. *Note Split Window::.  See also *Note Display: (elisp)Display.
  210.  
  211.    The variable `baud-rate' holds the the output speed of the terminal,
  212. as far as Emacs knows.  Setting this variable does not change the speed
  213. of actual data transmission, but the value is used for calculations
  214. such as padding.  It also affects decisions about whether to scroll
  215. part of the screen or redraw it instead--even when using a window
  216. system.  (We designed it this way, despite the fact that a window
  217. system has no true "output speed", to give you a way to tune these
  218. decisions.)
  219.  
  220. 
  221. File: emacs,  Node: Search,  Next: Fixit,  Prev: Display,  Up: Top
  222.  
  223. Searching and Replacement
  224. *************************
  225.  
  226.    Like other editors, Emacs has commands for searching for occurrences
  227. of a string.  The principal search command is unusual in that it is
  228. "incremental"; it begins to search before you have finished typing the
  229. search string.  There are also nonincremental search commands more like
  230. those of other editors.
  231.  
  232.    Besides the usual `replace-string' command that finds all
  233. occurrences of one string and replaces them with another, Emacs has a
  234. fancy replacement command called `query-replace' which asks
  235. interactively which occurrences to replace.
  236.  
  237. * Menu:
  238.  
  239. * Incremental Search::       Search happens as you type the string.
  240. * Nonincremental Search::  Specify entire string and then search.
  241. * Word Search::           Search for sequence of words.
  242. * Regexp Search::       Search for match for a regexp.
  243. * Regexps::           Syntax of regular expressions.
  244. * Search Case::           To ignore case while searching, or not.
  245. * Replace::           Search, and replace some or all matches.
  246. * Other Repeating Search:: Operating on all matches for some regexp.
  247.  
  248. 
  249. File: emacs,  Node: Incremental Search,  Next: Nonincremental Search,  Prev: Search,  Up: Search
  250.  
  251. Incremental Search
  252. ==================
  253.  
  254.    An incremental search begins searching as soon as you type the first
  255. character of the search string.  As you type in the search string, Emacs
  256. shows you where the string (as you have typed it so far) would be
  257. found.  When you have typed enough characters to identify the place you
  258. want, you can stop.  Depending on what you plan to do next, you may or
  259. may not need to terminate the search explicitly with RET.
  260.  
  261. `C-s'
  262.      Incremental search forward (`isearch-forward').
  263.  
  264. `C-r'
  265.      Incremental search backward (`isearch-backward').
  266.  
  267.    `C-s' starts an incremental search.  `C-s' reads characters from the
  268. keyboard and positions the cursor at the first occurrence of the
  269. characters that you have typed.  If you type `C-s' and then `F', the
  270. cursor moves right after the first `F'.  Type an `O', and see the
  271. cursor move to after the first `FO'.  After another `O', the cursor is
  272. after the first `FOO' after the place where you started the search.
  273. Meanwhile, the search string `FOO' has been echoed in the echo area.
  274.  
  275.    If you make a mistake in typing the search string, you can cancel
  276. characters with DEL.  Each DEL cancels the last character of search
  277. string.  This does not happen until Emacs is ready to read another
  278. input character; first it must either find, or fail to find, the
  279. character you want to erase.  If you do not want to wait for this to
  280. happen, use `C-g' as described below.
  281.  
  282.    When you are satisfied with the place you have reached, you can type
  283. RET, which stops searching, leaving the cursor where the search brought
  284. it.  Also, any command not specially meaningful in searches stops the
  285. searching and is then executed.  Thus, typing `C-a' would exit the
  286. search and then move to the beginning of the line.  RET is necessary
  287. only if the next command you want to type is a printing character, DEL,
  288. RET, or another control character that is special within searches
  289. (`C-q', `C-w', `C-r', `C-s', `C-y', `M-y', `M-r', or `M-s').
  290.  
  291.    Sometimes you search for `FOO' and find it, but not the one you
  292. expected to find.  There was a second `FOO' that you forgot about,
  293. before the one you were looking for.  In this event, type another `C-s'
  294. to move to the next occurrence of the search string.  This can be done
  295. any number of times.  If you overshoot, you can cancel some `C-s'
  296. characters with DEL.
  297.  
  298.    After you exit a search, you can search for the same string again by
  299. typing just `C-s C-s': the first `C-s' is the key that invokes
  300. incremental search, and the second `C-s' means "search again".
  301.  
  302.    To reuse earlier search strings, use the "search ring".  The
  303. commands `M-p' and `M-n' move through the ring to pick a search string
  304. to reuse.  These commands leave the selected search ring element in the
  305. minibuffer, where you can edit it.  Type `C-s' or `C-r' to terminate
  306. editing the string and search for it.
  307.  
  308.    If your string is not found at all, the echo area says `Failing
  309. I-Search'.  The cursor is after the place where Emacs found as much of
  310. your string as it could.  Thus, if you search for `FOOT', and there is
  311. no `FOOT', you might see the cursor after the `FOO' in `FOOL'.  At this
  312. point there are several things you can do.  If your string was
  313. mistyped, you can rub some of it out and correct it.  If you like the
  314. place you have found, you can type RET or some other Emacs command to
  315. "accept what the search offered".  Or you can type `C-g', which removes
  316. from the search string the characters that could not be found (the `T'
  317. in `FOOT'), leaving those that were found (the `FOO' in `FOOT').  A
  318. second `C-g' at that point cancels the search entirely, returning point
  319. to where it was when the search started.
  320.  
  321.    An upper-case letter in the search string makes the search
  322. case-sensitive.  If you delete the upper-case character from the search
  323. string, it ceases to have this effect.  *Note Search Case::.
  324.  
  325.    If a search is failing and you ask to repeat it by typing another
  326. `C-s', it starts again from the beginning of the buffer.  Repeating a
  327. failing reverse search with `C-r' starts again from the end.  This is
  328. called "wrapping around".  `Wrapped' appears in the search prompt once
  329. this has happened.
  330.  
  331.    The `C-g' "quit" character does special things during searches; just
  332. what it does depends on the status of the search.  If the search has
  333. found what you specified and is waiting for input, `C-g' cancels the
  334. entire search.  The cursor moves back to where you started the search.
  335. If `C-g' is typed when there are characters in the search string that
  336. have not been found--because Emacs is still searching for them, or
  337. because it has failed to find them--then the search string characters
  338. which have not been found are discarded from the search string.  With
  339. them gone, the search is now successful and waiting for more input, so
  340. a second `C-g' will cancel the entire search.
  341.  
  342.    To search for a newline, type LFD (also known as `C-j').  To search
  343. for another control character such as control-S or carriage return, you
  344. must quote it by typing `C-q' first.  This function of `C-q' is
  345. analogous to its meaning as an Emacs command: it causes the following
  346. character to be treated the way a graphic character would normally be
  347. treated in the same context.  You can also specify a character by its
  348. octal code: enter `C-q' followed by three octal digits.
  349.  
  350.    You can change to searching backwards with `C-r'.  If a search fails
  351. because the place you started was too late in the file, you should do
  352. this.  Repeated `C-r' keeps looking for more occurrences backwards.  A
  353. `C-s' starts going forwards again.  `C-r' in a search can be canceled
  354. with DEL.
  355.  
  356.    If you know initially that you want to search backwards, you can use
  357. `C-r' instead of `C-s' to start the search, because `C-r' as a key runs
  358. a command (`isearch-backward') to search backward.
  359.  
  360.    The characters `C-y' and `C-w' can be used in incremental search to
  361. grab text from the buffer into the search string.  This makes it
  362. convenient to search for another occurrence of text at point.  `C-w'
  363. copies the word after point as part of the search string, advancing
  364. point over that word.  Another `C-s' to repeat the search will then
  365. search for a string including that word.  `C-y' is similar to `C-w' but
  366. copies all the rest of the current line into the search string.  Both
  367. `C-y' and `C-w' convert the text they copy to lower case if the search
  368. is current not case-sensitive; this is so the search remains
  369. case-insensitive.
  370.  
  371.    The character `M-y' copies text from the kill ring into the search
  372. string.  It uses the same text that `C-y' as a command would yank.
  373. *Note Yanking::.
  374.  
  375.    When you exit the incremental search, it sets the mark to where point
  376. *was*, before the search.  That is convenient for moving back there.
  377. In Transient Mark mode, incremental search sets the mark without
  378. activating it, and does so only if the mark is not already active.
  379.  
  380.    To customize the special characters that incremental search
  381. understands, alter their bindings in the keymap `isearch-mode-map'.
  382. For a list of bindings, look at the documentation of `isearch-mode' with
  383. `C-h f isearch-mode RET'.
  384.  
  385. Slow Terminal Incremental Search
  386. --------------------------------
  387.  
  388.    Incremental search on a slow terminal uses a modified style of
  389. display that is designed to take less time.  Instead of redisplaying
  390. the buffer at each place the search gets to, it creates a new
  391. single-line window and uses that to display the line that the search
  392. has found.  The single-line window comes into play as soon as point
  393. gets outside of the text that is already on the screen.
  394.  
  395.    When you terminate the search, the single-line window is removed.
  396. Then Emacs redisplays the window in which the search was done, to show
  397. its new position of point.
  398.  
  399.    The slow terminal style of display is used when the terminal baud
  400. rate is less than or equal to the value of the variable
  401. `search-slow-speed', initially 1200.
  402.  
  403.    The number of lines to use in slow terminal search display is
  404. controlled by the variable `search-slow-window-lines'.  1 is its normal
  405. value.
  406.  
  407. 
  408. File: emacs,  Node: Nonincremental Search,  Next: Word Search,  Prev: Incremental Search,  Up: Search
  409.  
  410. Nonincremental Search
  411. =====================
  412.  
  413.    Emacs also has conventional nonincremental search commands, which
  414. require you to type the entire search string before searching begins.
  415.  
  416. `C-s RET STRING RET'
  417.      Search for STRING.
  418.  
  419. `C-r RET STRING RET'
  420.      Search backward for STRING.
  421.  
  422.    To do a nonincremental search, first type `C-s RET'.  This enters
  423. the minibuffer to read the search string; terminate the string with
  424. RET, and then the search takes place.  If the string is not found, the
  425. search command gets an error.
  426.  
  427.    The way `C-s RET' works is that the `C-s' invokes incremental
  428. search, which is specially programmed to invoke nonincremental search
  429. if the argument you give it is empty.  (Such an empty argument would
  430. otherwise be useless.)  `C-r RET' also works this way.
  431.  
  432.    However, nonincremental searches performed using `C-s RET' do not
  433. call `search-forward' right away.  The first thing done is to see if
  434. the next character is `C-w', which requests a word search.  *Note Word
  435. Search::.
  436.  
  437.    Forward and backward nonincremental searches are implemented by the
  438. commands `search-forward' and `search-backward'.  These commands may be
  439. bound to keys in the usual manner.  The feature that you can get to
  440. them via the incremental search commands exists for historical reasons,
  441. and to avoid the need to find suitable key sequences for them.
  442.  
  443. 
  444. File: emacs,  Node: Word Search,  Next: Regexp Search,  Prev: Nonincremental Search,  Up: Search
  445.  
  446. Word Search
  447. ===========
  448.  
  449.    Word search searches for a sequence of words without regard to how
  450. the words are separated.  More precisely, you type a string of many
  451. words, using single spaces to separate them, and the string can be
  452. found even if there are multiple spaces, newlines or other punctuation
  453. between the words.
  454.  
  455.    Word search is useful for editing a printed document made with a text
  456. formatter.  If you edit while looking at the printed, formatted version,
  457. you can't tell where the line breaks are in the source file.  With word
  458. search, you can search without having to know them.
  459.  
  460. `C-s RET C-w WORDS RET'
  461.      Search for WORDS, ignoring details of punctuation.
  462.  
  463. `C-r RET C-w WORDS RET'
  464.      Search backward for WORDS, ignoring details of punctuation.
  465.  
  466.    Word search is a special case of nonincremental search and is invoked
  467. with `C-s RET C-w'.  This is followed by the search string, which must
  468. always be terminated with RET.  Being nonincremental, this search does
  469. not start until the argument is terminated.  It works by constructing a
  470. regular expression and searching for that; see *Note Regexp Search::.
  471.  
  472.    Use `C-r RET C-w' to do backward word search.
  473.  
  474.    Forward and backward word searches are implemented by the commands
  475. `word-search-forward' and `word-search-backward'.  These commands may
  476. be bound to keys in the usual manner.  The feature that you can get to
  477. them via the incremental search commands exists for historical reasons,
  478. and to avoid the need to find suitable key sequences for them.
  479.  
  480. 
  481. File: emacs,  Node: Regexp Search,  Next: Regexps,  Prev: Word Search,  Up: Search
  482.  
  483. Regular Expression Search
  484. =========================
  485.  
  486.    A "regular expression" ("regexp", for short) is a pattern that
  487. denotes a class of alternative strings to match, possibly infinitely
  488. many.  In GNU Emacs, you can search for the next match for a regexp
  489. either incrementally or not.
  490.  
  491.    Incremental search for a regexp is done by typing `C-M-s'
  492. (`isearch-forward-regexp').  This command reads a search string
  493. incrementally just like `C-s', but it treats the search string as a
  494. regexp rather than looking for an exact match against the text in the
  495. buffer.  Each time you add text to the search string, you make the
  496. regexp longer, and the new regexp is searched for.  To search backward
  497. in the buffer, use `C-M-r' (`isearch-backward-regexp').
  498.  
  499.    All of the control characters that do special things within an
  500. ordinary incremental search have the same function in incremental regexp
  501. search.  Typing `C-s' or `C-r' immediately after starting the search
  502. retrieves the last incremental search regexp used; that is to say,
  503. incremental regexp and non-regexp searches have independent defaults.
  504. They also have separate search rings that you can access with `M-p' and
  505. `M-n'.
  506.  
  507.    If you type SPC in incremental regexp search, it matches any
  508. sequence of whitespace characters, including newlines.  If you want to
  509. match just a space, type `C-q SPC'.
  510.  
  511.    Note that adding characters to the regexp in an incremental regexp
  512. search can make the cursor move back and start again.  For example, if
  513. you have searched for `foo' and you add `\|bar', the cursor backs up in
  514. case the first `bar' precedes the first `foo'.
  515.  
  516.    Nonincremental search for a regexp is done by the functions
  517. `re-search-forward' and `re-search-backward'.  You can invoke these
  518. with `M-x', or bind them to keys, or invoke them by way of incremental
  519. regexp search with `C-M-s RET' and `C-M-r RET'.
  520.  
  521. 
  522. File: emacs,  Node: Regexps,  Next: Search Case,  Prev: Regexp Search,  Up: Search
  523.  
  524. Syntax of Regular Expressions
  525. =============================
  526.  
  527.    Regular expressions have a syntax in which a few characters are
  528. special constructs and the rest are "ordinary".  An ordinary character
  529. is a simple regular expression which matches that same character and
  530. nothing else.  The special characters are `$', `^', `.', `*', `+', `?',
  531. `[', `]' and `\'.  Any other character appearing in a regular
  532. expression is ordinary, unless a `\' precedes it.
  533.  
  534.    For example, `f' is not a special character, so it is ordinary, and
  535. therefore `f' is a regular expression that matches the string `f' and
  536. no other string.  (It does *not* match the string `ff'.)  Likewise, `o'
  537. is a regular expression that matches only `o'.  (When case distinctions
  538. are being ignored, these regexps also match `F' and `O', but we
  539. consider this a generalization of "the same string", rather than an
  540. exception.)
  541.  
  542.    Any two regular expressions A and B can be concatenated.  The result
  543. is a regular expression which matches a string if A matches some amount
  544. of the beginning of that string and B matches the rest of the string.
  545.  
  546.    As a simple example, we can concatenate the regular expressions `f'
  547. and `o' to get the regular expression `fo', which matches only the
  548. string `fo'.  Still trivial.  To do something nontrivial, you need to
  549. use one of the special characters.  Here is a list of them.
  550.  
  551. `. (Period)'
  552.      is a special character that matches any single character except a
  553.      newline.  Using concatenation, we can make regular expressions
  554.      like `a.b' which matches any three-character string which begins
  555.      with `a' and ends with `b'.
  556.  
  557. `*'
  558.      is not a construct by itself; it is a postfix operator, which
  559.      means to match the preceding regular expression repetitively as
  560.      many times as possible.  Thus, `o*' matches any number of `o's
  561.      (including no `o's).
  562.  
  563.      `*' always applies to the *smallest* possible preceding
  564.      expression.  Thus, `fo*' has a repeating `o', not a repeating
  565.      `fo'.  It matches `f', `fo', `foo', and so on.
  566.  
  567.      The matcher processes a `*' construct by matching, immediately, as
  568.      many repetitions as can be found.  Then it continues with the rest
  569.      of the pattern.  If that fails, backtracking occurs, discarding
  570.      some of the matches of the `*'-modified construct in case that
  571.      makes it possible to match the rest of the pattern.  For example,
  572.      matching `ca*ar' against the string `caaar', the `a*' first tries
  573.      to match all three `a's; but the rest of the pattern is `ar' and
  574.      there is only `r' left to match, so this try fails.  The next
  575.      alternative is for `a*' to match only two `a's.  With this choice,
  576.      the rest of the regexp matches successfully.
  577.  
  578. `+'
  579.      is a postfix character, similar to `*' except that it must match
  580.      the preceding expression at least once.  So, for example, `ca+r'
  581.      matches the strings `car' and `caaaar' but not the string `cr',
  582.      whereas `ca*r' matches all three strings.
  583.  
  584. `?'
  585.      is a postfix character, similar to `*' except that it can match the
  586.      preceding expression either once or not at all.  For example,
  587.      `ca?r' matches `car' or `cr'; nothing else.
  588.  
  589. `[ ... ]'
  590.      is a "character set", which begins with `[' and is terminated by
  591.      `]'.  In the simplest case, the characters between the two
  592.      brackets are what this set can match.
  593.  
  594.      Thus, `[ad]' matches either one `a' or one `d', and `[ad]*'
  595.      matches any string composed of just `a's and `d's (including the
  596.      empty string), from which it follows that `c[ad]*r' matches `cr',
  597.      `car', `cdr', `caddaar', etc.
  598.  
  599.      You can also include character ranges a character set, by writing
  600.      two characters with a `-' between them.  Thus, `[a-z]' matches any
  601.      lower-case letter.  Ranges may be intermixed freely with individual
  602.      characters, as in `[a-z$%.]', which matches any lower case letter
  603.      or `$', `%' or period.
  604.  
  605.      Note that the usual regexp special characters are not special
  606.      inside a character set.  A completely different set of special
  607.      characters exists inside character sets: `]', `-' and `^'.
  608.  
  609.      To include a `]' in a character set, you must make it the first
  610.      character.  For example, `[]a]' matches `]' or `a'.  To include a
  611.      `-', write `-' as the first or last character of the set, or put
  612.      it after a range.  Thus, `[]-]' matches both `]' and `-'.
  613.  
  614.      To include `^', make it other than the first character in the set.
  615.  
  616. `[^ ... ]'
  617.      `[^' begins a "complemented character set", which matches any
  618.      character except the ones specified.  Thus, `[^a-z0-9A-Z]' matches
  619.      all characters *except* letters and digits.
  620.  
  621.      `^' is not special in a character set unless it is the first
  622.      character.  The character following the `^' is treated as if it
  623.      were first (`-' and `]' are not special there).
  624.  
  625.      A complemented character set can match a newline, unless newline is
  626.      mentioned as one of the characters not to match.  This is in
  627.      contrast to the handling of regexps in programs such as `grep'.
  628.  
  629. `^'
  630.      is a special character that matches the empty string, but only at
  631.      the beginning of a line in the text being matched.  Otherwise it
  632.      fails to match anything.  Thus, `^foo' matches a `foo' which
  633.      occurs at the beginning of a line.
  634.  
  635. `$'
  636.      is similar to `^' but matches only at the end of a line.  Thus,
  637.      `xx*$' matches a string of one `x' or more at the end of a line.
  638.  
  639. `\'
  640.      has two functions: it quotes the special characters (including
  641.      `\'), and it introduces additional special constructs.
  642.  
  643.      Because `\' quotes special characters, `\$' is a regular
  644.      expression which matches only `$', and `\[' is a regular
  645.      expression which matches only `[', etc.
  646.  
  647.    Note: for historical compatibility, special characters are treated as
  648. ordinary ones if they are in contexts where their special meanings make
  649. no sense.  For example, `*foo' treats `*' as ordinary since there is no
  650. preceding expression on which the `*' can act.  It is poor practice to
  651. depend on this behavior; better to quote the special character anyway,
  652. regardless of where is appears.
  653.  
  654.    For the most part, `\' followed by any character matches only that
  655. character.  However, there are several exceptions: two-character
  656. sequences starting with `\' which have special meanings.  The second
  657. character in the sequence is always an ordinary character on their own.
  658. Here is a table of `\' constructs.
  659.  
  660. `\|'
  661.      specifies an alternative.  Two regular expressions A and B with
  662.      `\|' in between form an expression that matches anything that
  663.      either A or B matches.
  664.  
  665.      Thus, `foo\|bar' matches either `foo' or `bar' but no other string.
  666.  
  667.      `\|' applies to the largest possible surrounding expressions.
  668.      Only a surrounding `\( ... \)' grouping can limit the scope of
  669.      `\|'.
  670.  
  671.      Full backtracking capability exists to handle multiple uses of
  672.      `\|'.
  673.  
  674. `\( ... \)'
  675.      is a grouping construct that serves three purposes:
  676.  
  677.        1. To enclose a set of `\|' alternatives for other operations.
  678.           Thus, `\(foo\|bar\)x' matches either `foox' or `barx'.
  679.  
  680.        2. To enclose a complicated expression for the postfix operators
  681.           `*', `+' and `?' to operate on.  Thus, `ba\(na\)*' matches
  682.           `bananana', etc., with any (zero or more) number of `na'
  683.           strings.
  684.  
  685.        3. To mark a matched substring for future reference.
  686.  
  687.      This last application is not a consequence of the idea of a
  688.      parenthetical grouping; it is a separate feature which is assigned
  689.      as a second meaning to the same `\( ... \)' construct.  In practice
  690.      there is no conflict between the two meanings.  Here is an
  691.      explanation of this feature:
  692.  
  693. `\D'
  694.      after the end of a `\( ... \)' construct, the matcher remembers
  695.      the beginning and end of the text matched by that construct.  Then,
  696.      later on in the regular expression, you can use `\' followed by the
  697.      digit D to mean "match the same text matched the Dth time by the
  698.      `\( ... \)' construct."
  699.  
  700.      The strings matching the first nine `\( ... \)' constructs
  701.      appearing in a regular expression are assigned numbers 1 through 9
  702.      in order that the open-parentheses appear in the regular
  703.      expression.  `\1' through `\9' refer to the text previously
  704.      matched by the corresponding `\( ... \)' construct.
  705.  
  706.      For example, `\(.*\)\1' matches any newline-free string that is
  707.      composed of two identical halves.  The `\(.*\)' matches the first
  708.      half, which may be anything, but the `\1' that follows must match
  709.      the same exact text.
  710.  
  711.      If a particular `\( ... \)' construct matches more than once
  712.      (which can easily happen if it is followed by `*'), only the last
  713.      match is recorded.
  714.  
  715. `\`'
  716.      matches the empty string, provided it is at the beginning of the
  717.      buffer.
  718.  
  719. `\''
  720.      matches the empty string, provided it is at the end of the buffer.
  721.  
  722. `\b'
  723.      matches the empty string, provided it is at the beginning or end
  724.      of a word.  Thus, `\bfoo\b' matches any occurrence of `foo' as a
  725.      separate word.  `\bballs?\b' matches `ball' or `balls' as a
  726.      separate word.
  727.  
  728.      `\b' matches at the beginning or end of the buffer regardless of
  729.      what text appears next to it.
  730.  
  731. `\B'
  732.      matches the empty string, provided it is *not* at the beginning or
  733.      end of a word.
  734.  
  735. `\<'
  736.      matches the empty string, provided it is at the beginning of a
  737.      word.  `\<' matches at the beginning of the buffer only if a
  738.      word-constituent character follows.
  739.  
  740. `\>'
  741.      matches the empty string, provided it is at the end of a word.
  742.      `\>' matches at the end of the buffer only if the contents end with
  743.      a word-constituent character.
  744.  
  745. `\w'
  746.      matches any word-constituent character.  The syntax table
  747.      determines which characters these are.  *Note Syntax::.
  748.  
  749. `\W'
  750.      matches any character that is not a word-constituent.
  751.  
  752. `\sC'
  753.      matches any character whose syntax is C.  Here C is a character
  754.      which represents a syntax code: thus, `w' for word constituent,
  755.      `(' for open-parenthesis, etc.  Represent a character of
  756.      whitespace (which can be a newline) by either `-' or a space
  757.      character.
  758.  
  759. `\SC'
  760.      matches any character whose syntax is not C.
  761.  
  762.    The constructs that pertain to words and syntax are controlled by the
  763. setting of the syntax table (*note Syntax::.).
  764.  
  765.    Here is a complicated regexp, used by Emacs to recognize the end of a
  766. sentence together with any whitespace that follows.  It is given in Lisp
  767. syntax to enable you to distinguish the spaces from the tab characters.
  768. In Lisp syntax, the string constant begins and ends with a
  769. double-quote.  `\"' stands for a double-quote as part of the regexp,
  770. `\\' for a backslash as part of the regexp, `\t' for a tab and `\n' for
  771. a newline.
  772.  
  773.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  774.  
  775. This contains four parts in succession: a character set matching period,
  776. `?', or `!'; a character set matching close-brackets, quotes, or
  777. parentheses, repeated any number of times; an alternative in
  778. backslash-parentheses that matches end-of-line, a tab, or two spaces;
  779. and a character set matching whitespace characters, repeated any number
  780. of times.
  781.  
  782.    To enter the same regexp interactively, you would type TAB to enter
  783. a tab, and `C-q C-j' to enter a newline.  You would also type single
  784. slashes as themselves, instead of doubling them for Lisp syntax.
  785.  
  786. 
  787. File: emacs,  Node: Search Case,  Next: Replace,  Prev: Regexps,  Up: Search
  788.  
  789. Searching and Case
  790. ==================
  791.  
  792.    Incremental searches in Emacs normally ignore the case of the text
  793. they are searching through, if you specify the text in lower case.
  794. Thus, if you specify searching for `foo', then `Foo' and `foo' are also
  795. considered a match.  Regexps, and in particular character sets, are
  796. included: `[ab]' would match `a' or `A' or `b' or `B'.
  797.  
  798.    An upper-case letter in the incremental search string makes the
  799. search case-sensitive.  Thus, searching for `Foo' does not find `foo'
  800. or `FOO'.  This applies to regular expression search as well as to
  801. string search.  The effect ceases if you delete the upper-case letter
  802. from the search string.
  803.  
  804.    If you set the variable `case-fold-search' to `nil', then all
  805. letters must match exactly, including case.  This is a per-buffer
  806. variable; altering the variable affects only the current buffer, but
  807. there is a default value which you can change as well.  *Note Locals::.
  808. This variable applies to nonincremental searches also, including those
  809. performed by the replace commands (*note Replace::.).
  810.  
  811. 
  812. File: emacs,  Node: Replace,  Next: Other Repeating Search,  Prev: Search Case,  Up: Search
  813.  
  814. Replacement Commands
  815. ====================
  816.  
  817.    Global search-and-replace operations are not needed as often in Emacs
  818. as they are in other editors(1), but they are available.  In addition
  819. to the simple `M-x replace-string' command which is like that found in
  820. most editors, there is a `M-x query-replace' command which asks you, for
  821. each occurrence of the pattern, whether to replace it.
  822.  
  823.    The replace commands all replace one string (or regexp) with one
  824. replacement string.  It is possible to perform several replacements in
  825. parallel using the command `expand-region-abbrevs'.  *Note Expanding
  826. Abbrevs::.
  827.  
  828. * Menu:
  829.  
  830. * Unconditional Replace::  Replacing all matches for a string.
  831. * Regexp Replace::         Replacing all matches for a regexp.
  832. * Replacement and Case::   How replacements preserve case of letters.
  833. * Query Replace::          How to use querying.
  834.  
  835.    ---------- Footnotes ----------
  836.  
  837.    (1)  In some editors, search-and-replace operations are the only
  838. convenient way to make a single change in the text.
  839.  
  840. 
  841. File: emacs,  Node: Unconditional Replace,  Next: Regexp Replace,  Prev: Replace,  Up: Replace
  842.  
  843. Unconditional Replacement
  844. -------------------------
  845.  
  846. `M-x replace-string RET STRING RET NEWSTRING RET'
  847.      Replace every occurrence of STRING with NEWSTRING.
  848.  
  849. `M-x replace-regexp RET REGEXP RET NEWSTRING RET'
  850.      Replace every match for REGEXP with NEWSTRING.
  851.  
  852.    To replace every instance of `foo' after point with `bar', use the
  853. command `M-x replace-string' with the two arguments `foo' and `bar'.
  854. Replacement happens only in the text after point, so if you want to
  855. cover the whole buffer you must go to the beginning first.  All
  856. occurrences up to the end of the buffer are replaced; to limit
  857. replacement to part of the buffer, narrow to that part of the buffer
  858. before doing the replacement (*note Narrowing::.).
  859.  
  860.    When `replace-string' exits, it leaves point at the last occurrence
  861. replaced.  It sets the mark to the prior position of point (where the
  862. `replace-string' command was issued); use `C-u C-SPC' to move back
  863. there.
  864.  
  865.    A numeric argument restricts replacement to matches that are
  866. surrounded by word boundaries.  The argument's value doesn't matter.
  867.  
  868. 
  869. File: emacs,  Node: Regexp Replace,  Next: Replacement and Case,  Prev: Unconditional Replace,  Up: Replace
  870.  
  871. Regexp Replacement
  872. ------------------
  873.  
  874.    The `M-x replace-string' command replaces exact matches for a single
  875. string.  The similar command `M-x replace-regexp' replaces any match
  876. for a specified pattern.
  877.  
  878.    In `replace-regexp', the NEWSTRING need not be constant: it can
  879. refer to all or part of what is matched by the REGEXP.  `\&' in
  880. NEWSTRING stands for the entire match being replaced.  `\D' in
  881. NEWSTRING, where D is a digit, stands for whatever matched the Dth
  882. parenthesized grouping in REGEXP.  To include a `\' in the text to
  883. replace with, you must enter `\\'.  For example,
  884.  
  885.      M-x replace-regexp RET c[ad]+r RET \&-safe RET
  886.  
  887. replaces (for example) `cadr' with `cadr-safe' and `cddr' with
  888. `cddr-safe'.
  889.  
  890.      M-x replace-regexp RET \(c[ad]+r\)-safe RET \1 RET
  891.  
  892. performs the inverse transformation.
  893.  
  894. 
  895. File: emacs,  Node: Replacement and Case,  Next: Query Replace,  Prev: Regexp Replace,  Up: Replace
  896.  
  897. Replace Commands and Case
  898. -------------------------
  899.  
  900.    If the arguments to a replace command are in lower case, it preserves
  901. case when it makes a replacement.  Thus, the command
  902.  
  903.      M-x replace-string RET foo RET bar RET
  904.  
  905. replaces a lower case `foo' with a lower case `bar', an all-caps `FOO'
  906. with `BAR', and a capitalized `Foo' with `Bar'.  (These three
  907. alternatives-lower case, all caps, and capitalized, are the only ones
  908. that `replace-string' can distinguish.)
  909.  
  910.    If upper case letters are used in the second argument, they remain
  911. upper case every time that argument is inserted.  If upper case letters
  912. are used in the first argument, the second argument is always
  913. substituted exactly as given, with no case conversion.  Likewise, if the
  914. variable `case-replace' is set to `nil', replacement is done without
  915. case conversion.  If `case-fold-search' is set to `nil', case is
  916. significant in matching occurrences of `foo' to replace; this also
  917. inhibits case conversion of the replacement string.
  918.  
  919. 
  920. File: emacs,  Node: Query Replace,  Prev: Replacement and Case,  Up: Replace
  921.  
  922. Query Replace
  923. -------------
  924.  
  925. `M-% STRING RET NEWSTRING RET'
  926. `M-x query-replace RET STRING RET NEWSTRING RET'
  927.      Replace some occurrences of STRING with NEWSTRING.
  928.  
  929. `M-x query-replace-regexp RET REGEXP RET NEWSTRING RET'
  930.      Replace some matches for REGEXP with NEWSTRING.
  931.  
  932.    If you want to change only some of the occurrences of `foo' to
  933. `bar', not all of them, then you cannot use an ordinary
  934. `replace-string'.  Instead, use `M-%' (`query-replace').  This command
  935. finds occurrences of `foo' one by one, displays each occurrence and
  936. asks you whether to replace it.  A numeric argument to `query-replace'
  937. tells it to consider only occurrences that are bounded by
  938. word-delimiter characters.  This preserves case, just like
  939. `replace-string', provided `case-replace' is non-`nil', as it normally
  940. is.
  941.  
  942.    Aside from querying, `query-replace' works just like
  943. `replace-string', and `query-replace-regexp' works just like
  944. `replace-regexp'.  The shortest way to type this command name is `M-x
  945. que SPC SPC SPC RET'.
  946.  
  947.    The things you can type when you are shown an occurrence of STRING
  948. or a match for REGEXP are:
  949.  
  950. `SPC'
  951.      to replace the occurrence with NEWSTRING.
  952.  
  953. `DEL'
  954.      to skip to the next occurrence without replacing this one.
  955.  
  956. `, (Comma)'
  957.      to replace this occurrence and display the result.  You are then
  958.      asked for another input character to say what to do next.  Since
  959.      the replacement has already been made, DEL and SPC are equivalent
  960.      in this situation; both move to the next occurrence.
  961.  
  962.      You could type `C-r' at this point (see below) to alter the
  963.      replaced text.  You could also type `C-x u' to undo the
  964.      replacement; this exits the `query-replace', so if you want to do
  965.      further replacement you must use `C-x ESC ESC RET' to restart
  966.      (*note Repetition::.).
  967.  
  968. `RET'
  969.      to exit without doing any more replacements.
  970.  
  971. `. (Period)'
  972.      to replace this occurrence and then exit without searching for more
  973.      occurrences.
  974.  
  975. `!'
  976.      to replace all remaining occurrences without asking again.
  977.  
  978. `^'
  979.      to go back to the position of the previous occurrence (or what
  980.      used to be an occurrence), in case you changed it by mistake.
  981.      This works by popping the mark ring.  Only one `^' in a row is
  982.      meaningful, because only one previous replacement position is kept
  983.      during `query-replace'.
  984.  
  985. `C-r'
  986.      to enter a recursive editing level, in case the occurrence needs
  987.      to be edited rather than just replaced with NEWSTRING.  When you
  988.      are done, exit the recursive editing level with `C-M-c' to proceed
  989.      to the next occurrence.  *Note Recursive Edit::.
  990.  
  991. `C-w'
  992.      to delete the occurrence, and then enter a recursive editing level
  993.      as in `C-r'.  Use the recursive edit to insert text to replace the
  994.      deleted occurrence of STRING.  When done, exit the recursive
  995.      editing level with `C-M-c' to proceed to the next occurrence.
  996.  
  997. `C-l'
  998.      to redisplay the screen.  Then you must type another character to
  999.      specify what to do with this occurrence.
  1000.  
  1001. `C-h'
  1002.      to display a message summarizing these options.  Then you must type
  1003.      another character to specify what to do with this occurrence.
  1004.  
  1005.    Some other characters are aliases for the ones listed above: `y',
  1006. `n' and `q' are equivalent to SPC, DEL and RET.
  1007.  
  1008.    Aside from this, any other character exits the `query-replace', and
  1009. is then reread as part of a key sequence.  Thus, if you type `C-k', it
  1010. exits the `query-replace' and then kills to end of line.
  1011.  
  1012.    To restart a `query-replace' once it is exited, use `C-x ESC ESC',
  1013. which repeats the `query-replace' because it used the minibuffer to
  1014. read its arguments.  *Note C-x ESC ESC: Repetition.
  1015.  
  1016.    See also *Note Transforming File Names::, for Dired commands to
  1017. rename, copy, or link files by replacing regexp matches in file names.
  1018.  
  1019. 
  1020. File: emacs,  Node: Other Repeating Search,  Prev: Replace,  Up: Search
  1021.  
  1022. Other Search-and-Loop Commands
  1023. ==============================
  1024.  
  1025.    Here are some other commands that find matches for a regular
  1026. expression.  They all operate from point to the end of the buffer.
  1027.  
  1028. `M-x occur RET REGEXP RET'
  1029.      Display a list showing each line in the buffer that contains a
  1030.      match for REGEXP.  A numeric argument specifies the number of
  1031.      context lines to print before and after each matching line; the
  1032.      default is none.  To limit the search to part of the buffer,
  1033.      narrow to that part (*note Narrowing::.).
  1034.  
  1035.      The buffer `*Occur*' containing the output serves as a menu for
  1036.      finding the occurrences in their original context.  Click `Mouse-2'
  1037.      on an occurrence listed in `*Occur*', or position point there and
  1038.      type RET; this switches to the buffer that was searched and moves
  1039.      point to the original of the chosen occurrence.
  1040.  
  1041. `M-x list-matching-lines'
  1042.      Synonym for `M-x occur'.
  1043.  
  1044. `M-x count-matches RET REGEXP RET'
  1045.      Print the number of matches for REGEXP after point.
  1046.  
  1047. `M-x flush-lines RET REGEXP RET'
  1048.      Delete each line that follows point and contains a match for
  1049.      REGEXP.
  1050.  
  1051. `M-x keep-lines RET REGEXP RET'
  1052.      Delete each line that follows point and *does not* contain a match
  1053.      for REGEXP.
  1054.  
  1055. 
  1056. File: emacs,  Node: Fixit,  Next: Files,  Prev: Search,  Up: Top
  1057.  
  1058. Commands for Fixing Typos
  1059. *************************
  1060.  
  1061.    In this chapter we describe the commands that are especially useful
  1062. for the times when you catch a mistake in your text just after you have
  1063. made it, or change your mind while composing text on the fly.
  1064.  
  1065.    The most fundamental command for correcting erroneous editing is the
  1066. undo command, `C-x u' or `C-_'.  This command undoes a single command
  1067. (usually), a part of a command (in the case of `query-replace'), or
  1068. several consecutive self-inserting characters.  Consecutive repetitions
  1069. of `C-_' or `C-x u' undo earlier and earlier changes, back to the limit
  1070. of the undo information available.  *Note Undo::, for for more
  1071. information.
  1072.  
  1073. * Menu:
  1074.  
  1075. * Kill Errors:: Commands to kill a batch of recently entered text.
  1076. * Transpose::   Exchanging two characters, words, lines, lists...
  1077. * Fixing Case:: Correcting case of last word entered.
  1078. * Spelling::    Apply spelling checker to a word, or a whole file.
  1079.  
  1080. 
  1081. File: emacs,  Node: Kill Errors,  Next: Transpose,  Up: Fixit
  1082.  
  1083. Killing Your Mistakes
  1084. =====================
  1085.  
  1086. `DEL'
  1087.      Delete last character (`delete-backward-char').
  1088.  
  1089. `M-DEL'
  1090.      Kill last word (`backward-kill-word').
  1091.  
  1092. `C-x DEL'
  1093.      Kill to beginning of sentence (`backward-kill-sentence').
  1094.  
  1095.    The DEL character (`delete-backward-char') is the most important
  1096. correction command.  It deletes the character before point.  When DEL
  1097. follows a self-inserting character command, you can think of it as
  1098. canceling that command.  However, avoid the mistake of thinking of DEL
  1099. as a general way to cancel a command!
  1100.  
  1101.    When your mistake is longer than a couple of characters, it might be
  1102. more convenient to use `M-DEL' or `C-x DEL'.  `M-DEL' kills back to the
  1103. start of the last word, and `C-x DEL' kills back to the start of the
  1104. last sentence.  `C-x DEL' is particularly useful when you change your
  1105. mind about the phrasing of the text you are writing.  `M-DEL' and `C-x
  1106. DEL' save the killed text for `C-y' and `M-y' to retrieve.  *Note
  1107. Yanking::.
  1108.  
  1109.    `M-DEL' is often useful even when you have typed only a few
  1110. characters wrong, if you know you are confused in your typing and aren't
  1111. sure exactly what you typed.  At such a time, you cannot correct with
  1112. DEL except by looking at the screen to see what you did.  Often it
  1113. requires less thought to kill the whole word and start again.
  1114.  
  1115.